package model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Product {
	private Integer id;
	private Integer acid;
	private Integer type;
	private String name;
	private String brand; // 商标
	private String model; // 型号
	private Date producetime;
	private String isbn;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getAcid() {
		return acid;
	}

	public void setAcid(Integer acid) {
		this.acid = acid;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public Date getProducetime() {
		return producetime;
	}

	public void setProducetime(String str) throws ParseException {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		Date producetime = null;
		if (str.equals(null) || str.equals("")) {
			producetime = null;
		} else {
			producetime = sdf.parse(str);
		}
		this.producetime = producetime;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + ", acid=" + acid + ", type=" + type
				+ ", name=" + name + ", brand=" + brand + ", model=" + model
				+ ", producetime=" + producetime + ", isbn=" + isbn + "]";
	}

}
